﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CarSoldReport.ascx.cs" Inherits="CS424_9pts.Manager.Modules.CarSoldReport" %>
<%@ Register Assembly="System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>

<div class="section-header">
    <div class="title">
        <img src="Common/ico-sales.png" alt="Car Sold Statistics" />
    
    </div>
    <div class="options">
    </div>
</div>

<asp:SqlDataSource  ID="SqlDataSourceCarSold" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:CarManagementConnectionString %>"
                    
    SelectCommand="SELECT CarModel.ModelID, CarModel.ModelName, CarModel.Price, CarModel.Status, Car.CarID, Car.CarModel, CarModel.BrandID, Contract.ContractID, Contract.CarID AS Expr1, Car.Count, Contract.CustomerID, Contract.DatePurchased, Contract.TotalPrice FROM CarModel INNER JOIN Car ON CarModel.ModelID = Car.CarModel INNER JOIN Contract ON Car.CarID = Contract.CarID">
</asp:SqlDataSource>

<asp:GridView ID="gvCarSold" runat="server" AllowPaging="True" 
    AllowSorting="True" CellPadding="4" DataSourceID="SqlDataSourceCarSold" 
    ForeColor="#333333" GridLines="None" AutoGenerateColumns="False" 
    DataKeyNames="ModelID,CarID,ContractID" >
    <AlternatingRowStyle BackColor="White" />
    <Columns>
        <asp:BoundField DataField="ModelID" HeaderText="ModelID" InsertVisible="False" 
            ReadOnly="True" SortExpression="ModelID" />
        <asp:BoundField DataField="ModelName" HeaderText="ModelName" 
            SortExpression="ModelName" />
        <asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" />
        <asp:BoundField DataField="Status" HeaderText="Status" 
            SortExpression="Status" />
        <asp:BoundField DataField="CarID" HeaderText="CarID" InsertVisible="False" 
            ReadOnly="True" SortExpression="CarID" />
        <asp:BoundField DataField="CarModel" HeaderText="CarModel" 
            SortExpression="CarModel" />
        <asp:BoundField DataField="BrandID" HeaderText="BrandID" 
            SortExpression="BrandID" />
        <asp:BoundField DataField="ContractID" HeaderText="ContractID" 
            InsertVisible="False" ReadOnly="True" SortExpression="ContractID" />
        <asp:BoundField DataField="Expr1" HeaderText="Expr1" SortExpression="Expr1" />
        <asp:BoundField DataField="Count" HeaderText="Count" SortExpression="Count" />
        <asp:BoundField DataField="CustomerID" HeaderText="CustomerID" 
            SortExpression="CustomerID" />
        <asp:BoundField DataField="DatePurchased" HeaderText="DatePurchased" 
            SortExpression="DatePurchased" />
        <asp:BoundField DataField="TotalPrice" HeaderText="TotalPrice" 
            SortExpression="TotalPrice" />
    </Columns>
    <EditRowStyle BackColor="#2461BF" />
    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
    <RowStyle BackColor="#EFF3FB" />
    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
    <SortedAscendingCellStyle BackColor="#F5F7FB" />
    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
    <SortedDescendingCellStyle BackColor="#E9EBEF" />
    <SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
